#include <iostream>
#include <string>
using namespace std;

int main()
{
    string str;
    getline(cin, str);

    size_t pos = str.rfind(' ') + 1;

    cout << str.size() - pos << endl;

    return 0;
}